#include "menu_music.h"
#include "menu_frame.h"
#include "language.h"
#include <stdio.h>
#include <string.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
static bool bInitFlag = false;

const ST_MENU_IMAGE gstImageMusic = {"mmmmmmmmmm", "@"};

void MENU_MusicEnter(const ST_MENU_ITEM_INFO *pItemInfo)
{
}

void MENU_MusicExit(const ST_MENU_ITEM_INFO *pItemInfo)
{
}

void MENU_MusicLoad(const ST_MENU_ITEM_INFO *pItemInfo)
{
    bInitFlag = true;
}

void MENU_MusicTask(const ST_KEY_INFO *pKeyInfo, const ST_MENU_ITEM_INFO *pItemInfo)
{
#if 0
    int cmd = 0;

    if (bInitFlag)
    {
        bInitFlag = false;
        printf("--------------------------\n");
        printf("     %s%s\n", get_text(pItemInfo->uMenuDesc.textId), get_text(TEXT_FUNCTION_TEST));
        printf("--------------------------\n");
#ifdef _WIN32
        Sleep(1000);
#else
        sleep(1);
#endif
    }

    printf("%s(0-%s): ",
           get_text(TEXT_SELECT_OPTION), get_text(TEXT_EXIT));
    scanf(" %d", &cmd); // 空格作用是忽略上次的回车

    if (cmd == 0)
    {
        MMI_MenuExit(false);
    }
#else
    if (!pKeyInfo)
        return;

    switch (pKeyInfo->code)
    {
    case EN_USER_KEY_SOFT4:
        MMI_MenuExit(false);
        break;

    default:
        printf("--------------------------\n");
        printf("     %s%s\n", get_text(pItemInfo->uMenuDesc.textId), get_text(TEXT_FUNCTION_TEST));
        printf("--------------------------\n");
        break;
    }
    printf("%s(SOFT4-%s):\n", get_text(TEXT_SELECT_OPTION), get_text(TEXT_EXIT));
#endif
}